<template>
	<view class="container">
		<view class="avatar">
			<image src="/static/userimg/tx.png" mode="aspectFill" />
		</view>
		<view class="description">登录享受更多服务</view>
		<view class="login_button" @click="submitForm">
			<image class="img" :src="imgUrl+'upload/img/ws_static/static/img-login/login.png'" mode=""></image>
		</view>
		<view class="agreement">
			<label class="radio">
				<radio activeBackgroundColor="transparent" iconColor="#007AFF" @click="checkboxChange"
					style="transform:scale(0.7)" :checked="isAgree" />
				<text class="agreement-text">
					使用微信一键登录代表我已同意
					<text class="a_link" @click="goDetail">《用户协议》</text>
					和
					<text class="a_link" @click="goDetail">《隐私协议》</text>
					注册账号并使用微信绑定手机号码登录
				</text>
			</label>
		</view>
	</view>
</template>

<script>
	import Config from "@/config";
	export default {
		data() {
			return {
				isAgree: false, //是否同意协议
					imgUrl: Config.imgUrl,
			}
		},
		onLoad() {

		},
		methods: {
			checkboxChange() {
				this.isAgree = !this.isAgree;
			},
			submitForm() {
				if (this.isAgree) {
					// 如果同意，进行后续操作，如发送请求等
					console.log('同意隐私协议，提交表单');
				} else {
					// 如果没有同意，给出提示或阻止提交
					this.$api.msg("请先同意隐私协议")
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		flex-direction: column;
		align-items: center;
		height: 100vh;
		background-color: #fff;

		.avatar {
			width: 80px;
			height: 80px;
			border-radius: 50%;
			background-color: #e0e0e0;
			display: flex;
			align-items: center;
			margin-top: 20%;
			justify-content: center;
			margin-bottom: 20px;

			image {
				width: 100%;
				height: 100%;
				border-radius: 50%;
			}
		}

		.description {
			font-size: 18px;
			color: #000;
			font-weight: 400;
		}

		.login_button {
			display: flex;
			align-items: center;
			width: 100%;
			height: 48px;
			justify-content: center;
			margin-top: 7%;

			.img {
				width: 66%;
				height: 100%;
			}
		}

		.agreement {
			position: fixed;
			bottom: 5%;
			text-align: center;
			width: 96%;

			.agreement-text {
				font-size: 12px;
				color: #999;

				.a_link {
					color: #007AFF;
				}
			}
		}
	}
</style>